﻿using SpeakToMe.Core;
using SpeakToMe.Core.Interfaces;
using SpeakToMe.Presence;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestUI
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            BootStrapper bs = new BootStrapper();
            bs.Initialize();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            this.Dispatcher.Invoke(new Action(() => this.lbOutput.Items.Add(txtInput.Text)));
            IPresence presence = ServiceLocator.GetInstance<TestPresence>();
            presence.ProcessCommand(txtInput.Text, 1, new CallbackWrapper(new Action<string>((msg) =>
                {
                    this.Dispatcher.Invoke(new Action(() =>
                    {
                        lbOutput.Items.Add(msg);
                    }));
                })));
        }
    }
}
